function openAuthDialog() {
	showBlock("veil");
	showBlock("authDialog");
}

function closeAuthDialog() {
	hideBlock("authDialog");
	hideBlock("veil");
	var authFrame = document.getElementById("authFrame");
	if (authFrame) {
		authFrame.src = "about:blank";
	}
}

function showBlock(id) {
	var block = document.getElementById(id);
	if (block)
		block.style.display = "";
}

function hideBlock(id) {
	var block = document.getElementById(id);
	if (block)
		block.style.display = "none";
}

function isTopWindow() {
	if (window.parent == window)
		return true;
	else
		return false;
}

function doOnLoad() {
	if (!isTopWindow()) {
		window.parent.closeAuthDialog();
		var newContent = document.getElementById("content");
		var oldContent = window.parent.document.getElementById("content");
		oldContent.innerHTML = newContent.innerHTML;
	}
}